//package com.study.api;
//
//import com.study.dto.SubDTO;
//import com.study.utils.Consts;
//import lombok.extern.slf4j.Slf4j;
//import org.redisson.api.RTopic;
//import org.redisson.api.RedissonClient;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.time.LocalDateTime;
//
///**
// * @author zhuzi
// * 2024/3/25 23:37
// */
//@Slf4j
//@RestController
//@RequestMapping("api")
//public class PublishController {
//    /* @Resource
//     DelayedQueue delayedQueue;*/
//    @Autowired
//    private RedissonClient redissonClient;
//
//    //@GetMapping("pub")
//    public Object pubMsg() {
//        RTopic rTopic = redissonClient.getTopic(Consts.TopicName);
//
//        SubDTO subDTO = new SubDTO<>().setType("CEB300").setPubDateTime(LocalDateTime.now()).setData("我是中国人😄");
//        return rTopic.publish(subDTO);
//    }
//
//    //@GetMapping("pubb")
//    public Object pubMsgb() {
//        RTopic rTopic = redissonClient.getTopic(Consts.TopicName + ":b");
//
//        SubDTO subDTO = new SubDTO<>().setType("CEB300").setPubDateTime(LocalDateTime.now()).setData("我是中国人😄");
//        return rTopic.publish(subDTO);
//    }
//
//    //@GetMapping("delay")
//    public Object dealy() {
//        //delayedQueue.pubData();
//        return LocalDateTime.now();
//    }
//}
